Repository navigation
Added playwright regression test and fixed more bugs - #7
Merged
Merged
Conversation
vagkaratzas
approved these changes
Sep 17, 2026
vagkaratzas
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed PR #7 with particular attention to the worker regression. The production build passed; 26/26 Vitest and 12/12 Playwright tests passed, including the new 80-node production-bundle test for kk and stress. The .name-based dispatch matches the minified function names and resolves the reported distanceLayout is not defined error.
One non-blocking follow-up: metrics.ts hard-codes 123 and 2500 in worker-safe code, so future changes to FR_SEED or the layout limit could silently diverge between worker and main-thread behavior. Please consider injecting these values into the worker preamble or passing them explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a Playwright regression test — and it immediately paid off by catching two more instances of the exact bug class, not just the one I'd already fixed.
The new test (frontend/e2e/smoke.spec.ts, "Kamada-Kawai and Stress layouts run in the background worker on a big network"): posts an 80-node network via /api/external (deterministically over the >60-node worker threshold), runs "kk" then "stress" from the UI, and asserts both
that node positions actually changed and that #layoutStatus is empty (no error). It runs against the real production build, exactly like the rest of this suite (playwright.config.ts's webServer does npm run build && server.py), which is what makes it able to catch
minification-only bugs at all.
What it found: my earlier fix only addressed the dispatcher calling functions by hardcoded name. But getFrWorker()'s pasted function bodies (workStep, frLayout, distanceLayout) also freely reference:
Both are the identical underlying anti-pattern (a function's .toString()'d body, pasted into an isolated worker, referencing something outside its own scope by a name the minifier is free to rename) — my first fix only handled it for functions (via .name); this pass fixes it for
data: